package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.lihaoming.Order1;
import com.cskaoyan.bean.lihaoming.UnOrder;
import com.cskaoyan.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lihaoming
 * @Description
 * @Create 2022-06-29 16:53
 * @Version
 */
@RestController
public class WeixinIndexController {
    @Autowired
    UserMapper userMapper;
    @RequestMapping("wx/user/index")
    public BaseRespVo index(){
        Integer unrecv=userMapper.selectUnRecv();
        Integer uncomment=userMapper.selectUnComment();
        if(uncomment==null){
            uncomment=0;
        }
        Integer unpaid=userMapper.selectUnPaid();
        Integer unship=userMapper.selectUnShip();
        UnOrder order = new UnOrder();
        Order1 order1 = new Order1();
        order.setUnrecv(unrecv);
        order.setUncomment(uncomment);
        order.setUnpaid(unpaid);
        order.setUnship(unship);
        order1.setOrder(order);
        return BaseRespVo.ok(order1);
    }
}
